/**   
  * @Description: TODO(用一句话描述该文件做什么) 
  * @author wby  
  * @date 2019年6月21日 下午9:34:56 
  * @version V1.0   
  */
package com.wing.jpa.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.wing.jpa.entity.User;
import com.wing.jpa.repository.UserRepository;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "用户接口")
@RestController
public class UserController {

	@Autowired
	private UserRepository userRepository;

	@ApiOperation(value = "根据id获取用户")
	@GetMapping("/user/{id}")
	public User findById(@PathVariable String id) {
		return this.userRepository.findById(id).get();
	}
}
